﻿using System;
using System.Collections.Generic;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Messaging;
using Ninject;
using ProjectWizardManagement.Entity.Model;
using ProjectWizardManagementv1.Infrastructure.Abstract;
using ProjectWizardManagementv1.ViewModels;
using ProjectWizardManagementv1.ViewModels.Concrete;
using ProjectWizardManagementv1.Views;

namespace ProjectWizardManagementv1.Infrastructure.Concrete
{
    public class NinjectServiceLocator : IServiceLocator
    {
        private readonly IKernel _kernel;

        public ProjectDialogViewModel ProjectDialogViewModel
        {
            get { return _kernel.Get<ProjectDialogViewModel>(); }
        }

        public WorkspaceViewModel WorkspaceViewModel
        {
            get { return _kernel.Get<WorkspaceViewModel>(); }
        }

        public TasksControlViewModel TasksControlViewModel
        {
            get { return _kernel.Get<TasksControlViewModel>(); } 
        }

        public CalendarControlViewModel CalendarControlViewModel
        {
            get { return _kernel.Get<CalendarControlViewModel>(); }
        }

        public NinjectServiceLocator()
        {
            _kernel = new StandardKernel();
            LoadViewModels();
        }

        public void LoadViewModels()
        {
            _kernel.Bind<WorkspaceViewModel>().ToSelf();
            _kernel.Bind<ProjectDialogViewModel>().ToSelf();
            _kernel.Bind<TasksControlViewModel>().ToSelf();
            _kernel.Bind<CalendarControlViewModel>().ToSelf();
        }
    }


}
